﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GDF_kaart_inlezen;

namespace GDF_kaart_inlezen.strategy_classes
{
    class SectionHeader : ReadingStrategy
    {
        public SectionHeader()
        {
            recordCode = "16";
        }

        public override void Process(string record)
        {
            counter = 0;
            String fieldValue;

            if (record.Substring(0, 2) == recordCode) record = record.Substring(2);
            fieldValue = GetFieldValue("REC_CODE", ref record);
            string rec_code = fieldValue;
            if (rec_code == "01") //Section Indentification Subrecord
            {
                fieldValue = GetFieldValue("SECT_ID", ref record);
                //Implement processing
                fieldValue = record.Trim();
                //Implement processing (GEO_AREA)
            }
            else if (rec_code == "07") //Section Border Subrecord
            {
                fieldValue = GetFieldValue("XY_CONFAC", ref record);
                //Implement processing
                fieldValue = GetFieldValue("Z_CONFAC", ref record);
                //Implement processing
                fieldValue = GetFieldValue("X_OFFSET", ref record);
                //Implement processing
                fieldValue = GetFieldValue("Y_OFFSET", ref record);
                //Implement processing
                fieldValue = GetFieldValue("Z_OFFSET", ref record);
                //Implement processing
                fieldValue = GetFieldValue("X_MAX", ref record);
                //Implement processing
                fieldValue = GetFieldValue("Y_MAX", ref record);
                //Implement processing
                fieldValue = GetFieldValue("X_MIN", ref record);
                //Implement processing
                fieldValue = GetFieldValue("Y_MIN", ref record);
                //Implement processing
            }
        }
    }
}
